package com.ithaipeng.order.web;

import com.ithaipeng.order.pojo.Order;
import com.ithaipeng.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {

   @Autowired
   private OrderService orderService;

    @GetMapping("/{orderId}")
    public Order queryOrderByUserId(@PathVariable("orderId") Long orderId,
                                    @RequestHeader(value = "Truth",required = false)String truth) {
        System.err.println("truth:"+truth);
        // 根据id查询订单并返回
        return orderService.queryOrderById(orderId);
    }
}
